<template>
    <div>
        <back></back>
        <div class="invitBox">
            <input type="text" id="invitUrl" v-bind:value="invitUrl">
            <a class="button" data-clipboard-target="#invitUrl">点击复制邀请链接</a>
        </div>
    </div>
</template>
<style>
.button,
#invitUrl {
    display: block
}

#invitUrl {
    width: 80%;
    height: 1rem;
    margin: 1rem auto;
    border: 1px solid #eee;
    border-radius: 6px;
    padding-left: .3rem
}

.button {
    width: 40%;
    height: 1rem;
    margin: 1rem auto;
    background: #333a4b;
    color: white;
    line-height: 1rem;
    text-align: center;
    border-radius: 6px
}
</style>
<script>

import Clipboard from 'clipboard'
import back from "@/components/common/back"

export default {
    components: { back },
    data() {
        return {
            invitUrl: "https://test.binhetouzi.com/page/register.html?recommandPerson=" + localStorage.plainpassword
        }
    },
    mounted() {
        this.newClipboard()
    },
    methods: {
        newClipboard() {
            const clipboard = new Clipboard('.button');
            clipboard.on('success', function (e) {
                
            });
        }
    }
}
</script>
